<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link th:href="@{/erp/assets/css/bootstrap.min.css}" rel="stylesheet"/>
    <link rel="stylesheet" th:href="@{/erp/css/style.css}"/>
    <link th:href="@{/erp/assets/css/codemirror.css}" rel="stylesheet">
    <link rel="stylesheet" th:href="@{/erp/assets/css/ace.min.css}"/>
    <link rel="stylesheet" th:href="@{/erp/assets/css/font-awesome.min.css}"/>
    <link rel="stylesheet" th:href="@{/erp/font/css/font-awesome.min.css}"/>
    <link rel="stylesheet" th:href="@{/erp/assets/css/font-awesome-ie7.min.css}"/>
    <link rel="stylesheet" th:href="@{/erp/assets/css/ace-ie.min.css}"/>
    <script th:src="@{/erp/js/jquery-1.9.1.min.js}"></script>
    <script th:src="@{/erp/assets/js/bootstrap.min.js}"></script>
    <script type="text/javascript" th:src="@{/erp/Widget/Validform/5.3.2/Validform.min.js}"></script>
    <script th:src="@{/erp/assets/js/jquery.dataTables.min.js}"></script>
    <script th:src="@{/erp/assets/js/jquery.dataTables.bootstrap.js}"></script>
    <script th:src="@{/erp/assets/js/typeahead-bs2.min.js}"></script>
    <script th:src="@{/erp/assets/layer/layer.js}" type="text/javascript"></script>
    <script th:src="@{/erp/assets/js/jquery-ui-1.10.3.custom.min.js}"></script>
    <script th:src="@{/erp/assets/js/jquery.ui.touch-punch.min.js}"></script>
    <script th:src="@{/erp/assets/js/ace-elements.min.js}"></script>
    <script th:src="@{/erp/assets/js/ace.min.js}"></script>
    <script th:src="@{/erp/js/lrtk.js}" type="text/javascript"></script>
    <script th:src="@{/erp/assets/laydate/laydate.js}" type="text/javascript"></script>
    <title>采购订单物流明细</title>
</head>
<body>

<div class="margin clearfix">
    <div class="Order_Details_style" >
        <div class="Numbering" >采购订单编号:<b></b></div>
    </div>
    <div class="detailed_style">
        <!--收件人信息-->
        <div class="Receiver_style" th:each="logistics:${logistics}">

            <div class="Info_style clearfix">
                <div class="col-xs-3">
                    <label class="label_name" for="form-field-2"> 物品名称： </label>
                    <div class="o_content" th:text="${logistics.pName}"></div>
                </div>
                <div class="col-xs-3">
                    <label class="label_name" for="form-field-2"> 产品编号： </label>
                    <div class="o_content"  th:text="${logistics.pNumber}"></div>
                </div>

                <div class="col-xs-3">
                    <label class="label_name" for="form-field-2"> 数量： </label>
                    <div class="o_content" id="pnumer" th:text="${logistics.order.number}"></div>
                </div>
                <div class="col-xs-3">
                    <label class="label_name" for="form-field-2"> 卖家名称： </label>
                    <div class="o_content" th:text="${logistics.company.companyName}"></div>
                </div>
                <div class="col-xs-3">
                    <label class="label_name" for="form-field-2"> 支付方式： </label>
                    <div class="o_content" th:text="${logistics.order.orderType}"></div>
                </div>
                <div class="col-xs-3">
                    <label class="label_name" for="form-field-2"> 订单编号： </label>
                    <div class="o_content" id="orderId" th:text="${logistics.order.orderId}"></div>
                </div>
                <div class="col-xs-3">
                    <label class="label_name" for="form-field-2"> 交易时间： </label>
                    <div class="o_content" id="time" th:text="${logistics.order.dealTime}"></div>
                </div>
                <div class="col-xs-3">
                    <label class="label_name" for="form-field-2"> 总价： </label>
                    <div class="o_content" th:text="${logistics.order.money}"></div>
                </div>
                <div class="col-xs-3">
                    <label class="label_name" for="form-field-2"> 发件地址： </label>
                    <div class="o_content"
                         th:text="${logistics.company.companyProvince}+''+${logistics.company.companyCity}+''+${logistics.company.companyArea}+''+${logistics.company.companyAddress}"></div>
                </div>
            </div>
            <div class="title_name">物流信息</div>
            <div data-mohe-type="kuaidi_new" class="g-mohe " id="mohe-kuaidi_new">
                <div id="mohe-kuaidi_new_nucom">
                    <div class="mohe-wrap mh-wrap">
                        <div class="mh-cont mh-list-wrap mh-unfold">
                            <div class="mh-list">
                                <ul>
                                    <li class="first">
                                        <p>2015-04-28 11:23:28</p>
                                        <p>妥投投递并签收，签收人：他人收 他人收</p>
                                        <span class="before"></span><span class="after"></span><i
                                            class="mh-icon mh-icon-new"></i></li>
                                    <li>
                                        <p>2015-04-28 00:00:00</p>
                                        <p>离开中山市 发往深圳市（经转）</p>
                                        <span class="before"></span><span class="after"></span></li>
                                    <li>
                                        <p>2015-04-27 15:00:00</p>
                                        <p>到达广东省邮政速递物流有限公司中山三角邮件处理中心处理中心（经转）</p>
                                        <span class="before"></span><span class="after"></span></li>
                                    <li>
                                        <p>2015-04-27 08:46:00</p>
                                        <p>离开泉州市 发往中山市</p>
                                        <span class="before"></span><span class="after"></span></li>
                                    <li>
                                        <p>2015-04-26 17:12:00</p>
                                        <p>泉州市速递物流分公司南区电子商务业务部已收件，（揽投员姓名：王晨光;联系电话：<a
                                                href="tel:13774826403">13774826403</a>）</p>
                                        <span class="before"></span><span class="after"></span></li>
                                </ul>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
    <span th:text="${orderStatus}" id="status" hidden="hidden" ></span>
    <div class="Button_operation" th:if="${orderStatus} lt 4">
        <button onclick="member_fh()" class="btn btn-primary radius" type="button" id="sure">确定签收</button>
    </div>
</div>
<!--发货图层-->
<div class="add_menber" id="add_menber_style" style="display:none">
    <ul class=" page-content">
        <li>
            <label class="label_name" style="width:100px">订单编号：</label>
            <span class="add_name" id="orderId1"><label
                    class="label_name"></label></span>
            <div class="prompt r_f"></div>
        </li>
        <br/>

        <div class="prompt r_f"></div>
        </li>
    </ul>
    <div class="Operate_cont clearfix">

        <label class="form-label col-5"> 请选入库仓:</label>
        <div class="formControls col-5">
            <div id="test1">
                <select  id="wareName">
                    <option value="">请选择</option>
                </select>
                <br><br>

            </div>
        </div>
        <script th:src="@{/js/warename.js}"></script>
        <script>
            function member_fh(id) {
                layer.open({
                    type: 1,
                    title: '确认收货',
                    maxmin: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['800px', ''],
                    content: $('#add_menber_style'),
                    btn: ['确认', '取消'],
                    yes: function (index, layero) {
                        var num = 0;
                        var str = "";
                        $(".add_menber input[type$='text']").each(function (n) {
                            if ($(this).val() == "") {

                                layer.alert(str += "" + $(this).attr("name") + "不能为空！\r\n", {
                                    title: '提示框',
                                    icon: 0,
                                });
                                num++;
                                return false;
                            }
                        });
                        if (num > 0) {
                            return false;
                        } else {
                            var value1=$("#wareName option:selected").val();
                             console.log(value1);
                            var headname="";
                            $.ajax({
                                data:{"id":value1},
                                async:false,
                                url: '[[@{/warehouse/WarePerson}]]',
                                success: function (data) {
                                    if(data.rs){
                                        headname=data.data;
                                    }else{
                                        layer.msg(data,msg,{icon:2,time:2000});
                                    }
                                }
                            })

                            $.ajax({
                                data: {
                                    "orderId": $('#orderId1').text()
                                },
                                type: 'post',
                                dataType: 'josn',
                                url: '/order/updateStatus',
                                success: function (data) {
                                    if(data.rs){
                                        alert(data);
                                    }else{
                                        layer.msg(data,msg,{icon:2,time:2000});
                                    }
                                }
                            });

                            $.ajax({
                                data: {
                                    "orderId": $('#orderId1').text()
                                    , "wareName":$('#wareName option:selected').text()
                                    , "num": $('#pnumer').text()
                                    , "handoverDate": $('#time').text()
                                    , "head": headname
                                },
                                type: 'post',
                                dataType: 'josn',
                                url: '/handover/addshopping',
                                success: function (data) {
                                    if(data.rs){
                                        alert(data);
                                    }else{
                                        layer.msg(data,msg,{icon:2,time:2000});
                                    }
                                }
                            });
                            parent.layer.alert('添加成功！', {
                                title: '提示框',
                                icon: 1,
                            });
                            layer.close(index);
                            window.parent.document.getElementById('iframe').contentWindow.location.reload(true);
                        }
                    }
                });
            }
        </script>
    </div>
</div>
</body>
</html>
